<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>主页面</title>
	<%@include file="common/common.jsp" %>       
</head>
<script type="text/javascript">
function addTab(node){
	var t = $('#home-tabs');
	var opts = {
			title : node.text,
			href : node.attributes.url,
			closable : true,
			fit : true,
			border : false
	}
	if(t.tabs('exists',opts.title)){
		var tab = t.tabs("select",opts.title).tabs("getSelected");
		t.tabs('update',{
			tab : tab,
			options: opts
		});
	}else{
		t.tabs('add',opts);
	}
}

$(function(){
	$('#home-tree').tree({
		url : '${path}/menuTree/selectMenuTrees',
		onClick : function(node){
			if(node.attributes && node.attributes.url){
				addTab(node);
			}
		}
	});
});

</script>
<body>
<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'north'" style="height:50px;"></div>   
    <div data-options="region:'west',title: ' '" style="width:200px;">
    	<ul id='home-tree'>
    	</ul>
    </div>   
    <div data-options="region:'center'" style="background:#eee;">
    	<div id='home-tabs' class='easyui-tabs' style='height: 100%;'>
    		<div title="首页">
				<h2 style="text-align: center">欢迎登录晴天人员权限管理系统</h2>
			</div>
    	</div>
    </div>     
</div>
</body>
</html>
